io.Connect Browser
3.4.6io.Connect Browser allows web apps to integrate with other apps that are part of the same io.Connect Browser project via a set of APIs. io.Connect Browser enables you to share data between apps, expose functionality, manage windows and notifications.
Referencing
The @interopio/browser
library is available both as a single JavaScript file, which you can include in your web apps using a <script>
tag, and as a Node.js module:
<script type="text/javascript" src="browser.umd.js"></script>
Or:
import IOBrowser from "@interopio/browser";
When deploying your app in production, it's recommended to always reference a specific minified version:
<script type="text/javascript" src="browser.umd.min.js"></script>
Initialization
The @interopio/browser
library attaches a factory function to the global window
object at runtime - IOBrowser()
.
It can be invoked with an optional configuration object to initialize the library and connect to the io.Connect Browser environment. The factory function resolves with the io
API object:
const initializeIOConnect = async () => {
// Initializing the Workspaces library.
const initOptions = {
libraries: [IOWorkspaces]
};
// Use the object returned from the factory function
// to access the IOConnect Browser APIs.
const io = await IOBrowser(initOptions);
// Here the library is initialized and you can access all io.Connect Browser APIs.
};
initializeIOConnect().catch(console.error);
APIobject
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
agm | API | Interop library. |
||
appManager | API | |||
channels | API | |||
contexts | API | Contexts library. |
||
info | object | Info object containing versions of all included libraries and io.Connect itself. |
||
intents | API | |||
interop | API | Interop library. |
||
layouts | API | |||
notifications | API | |||
prefs | API | |||
search | IOConnectSearch | |||
themes | API | |||
version | string | io.Connect version. |
||
webPlatform | IOConnectBrowser | |||
windows | API | |||
workspaces | API |
Methods
donemethod
Signature
() => Promise<void>
Description
Disposes the io.Connect API. This will remove all Interop methods and streams registered by the application.
feedbackmethod
Signature
(info?: FeedbackInfo) => void
Description
Brings up the IOConnect Desktop feedback dialog.
Parameters
Name | Type | Required | Description |
---|---|---|---|
info | FeedbackInfo |
Configobject
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
contexts | ContextsConfig | Enable, disable and configure the Contexts API. Enabled by default |
||
exposeAPI | boolean | true | Configures whether the library will share the initialized API object upon request via a custom web event. |
|
intents | Config | |||
libraries | ((io: API, config?: Config | IOConnectDesktop) => Promise<void>)[] | A list of io.Connect libraries which will be initiated internally and provide access to specific functionalities |
||
memoizeAPI | boolean | false | If |
|
notifications | Settings | Configure the system logger. Used mostly for during development. |
||
systemLogger | SystemLogger | Configure the system logger. Used mostly for during development. |
||
widget | IOBrowserWidget |
SystemLoggerobject
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
callback | (logInfo: any) => void | |||
level | IOConnectCore |
IOConnectBrowserFactoryFunctionfunction
Signature
(config?: Config) => Promise<API | IOConnectDesktop>
Description
Factory function that creates a new ioconnect instance. If your application is running in IOConnect Desktop this will return a Glue42.Glue API, which is a super-set of the IOConnectBrowser.API.
Parameters
Name | Type | Required | Description |
---|---|---|---|
config | Config |